package cn.hss.object;

/**
 * @author 作者：HeShaoShuai
 * @Email 邮箱：2569819541@qq.com
 * @Date 日期：2023/4/25 16:57
 * @Package 包名：cn.hss.object
 * @Project 项目名：JavaSE
 * @Version 1.0
 */
public class Person {
	public String name;
	private int age;
	char sex;

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		if(age>=0 && age <=130){
			this.age=age;
		}else{
			System.out.println("数据非法");
		}
	}

	public void study(){
		System.out.println("studying");
	}
	public int showAge(){
		return age;
	}
	public void addAge(int addAge){
		age +=addAge;
		System.out.println(age);
	}
}
